import Cookies from 'js-cookie'

const TokenKey = window.location.hostname+"_"+window.location.port+'Admin-Token'
const sidkey=window.location.hostname+"_"+window.location.port+"_SID"
const loginshowtype='1'
export function getToken() {
  let token=Cookies.get(TokenKey);
  return token=='undefined'||typeof token=='undefined'?"":token
}
export function setToken(token) {
  return Cookies.set(TokenKey, token)
}
export function removeToken() {
  return Cookies.remove(TokenKey)
}
export function getSid() {
  return Cookies.get(sidkey)
}
export function setSid(sid) {
  return Cookies.set(sidkey,sid)
}
export function removeSid() {
  return Cookies.remove(sidkey)
}
export function getLoginshow() {
  let showtype=Cookies.get(loginshowtype);
  if(showtype=='undefined'||typeof showtype=='undefined'){
       setLoginshow('1')
  }
  return Cookies.get(loginshowtype)
}
export function setLoginshow(type) {
  return Cookies.set(loginshowtype, type)
}
export function removeLoginshow() {
  return Cookies.remove(loginshowtype)
}